package com.ironman.common.entity;

import lombok.Getter;

import java.util.Date;
import java.util.Objects;

@Getter
public class HeartrateData extends BaseData {

    /**
     * 心率
     */
    private final Integer heartRate;

    public HeartrateData(Date ts, Integer heartRate) {
        super(ts);
        this.heartRate = heartRate;
    }

    @Override
    public Double calValue() {
        return Objects.nonNull(heartRate) ? heartRate * 1.0 : null;
    }
}